const dayjs = require('dayjs')

function getDate(format = 'YYYY-MM-DD') {
  return dayjs().format(format)
}
function getCurrentWeek() {
  const startOfWeek = dayjs().day(1).format('YYYY-MM-DD')
  const endOfWeek = dayjs().day(7).format('YYYY-MM-DD')
  return {
    startOfWeek,
    endOfWeek,
  }
}

module.exports = {
  getDate,
  getCurrentWeek,
}
